package com.xmtlxx.system.mapper;

import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.domain.entity.SysWorkflow;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xmtlxx.system.domain.bo.SysWorkflowBo;
import com.xmtlxx.system.domain.vo.SysWorkflowVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 工作流程Mapper接口
 *
 * @author xmtlxx
 * @date 2022-04-24
 */
public interface SysWorkflowMapper extends BaseMapperPlus<SysWorkflowMapper, SysWorkflow, SysWorkflowVo> {
    /**
     * 根据条件分页查询工作流程
     *
     * @param sysWorkflowBo 工作流程
     * @return Page SysWorkflow
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "s.create_by"),
        @DataColumn(key = "deptName", value = "s.create_by"),
        @DataColumn(key = "userName", value = "s.create_by")
    })
    Page<SysWorkflowVo> selectPageSysWorkflowList(@Param("page") Page<SysWorkflow> page,@Param("sysWorkflow") SysWorkflowBo sysWorkflow);

    /**
     * 查询工作流程列表
     *
     * @param sysWorkflowBo 工作流程
     * @return 工作流程集合
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "s.create_by"),
        @DataColumn(key = "deptName", value = "s.create_by"),
        @DataColumn(key = "userName", value = "s.create_by")
    })
    public List<SysWorkflow> selectSysWorkflowList(@Param("sysWorkflow") SysWorkflowBo sysWorkflow);

    /**
     * 删除工作流程
     *
     * @param sysWorkflowBo 工作流程
     */
    void deleteSysWorkflow(@Param("sysWorkflow") SysWorkflowBo sysWorkflow);

}
